package com.wxisme.ssm.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.wxisme.ssm.mapper.UserMapper;
import com.wxisme.ssm.po.User;



@Controller
public class UserController {
	
	@Autowired
	private UserMapper userMapper;
	
	
	/**
	 * 查找用户
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("/queryUser.action")
	public ModelAndView queryUser() throws Exception {
		
		ModelAndView modelAndView = new ModelAndView();
		
		User user = userMapper.findUserById(1);
		
		
		modelAndView.addObject("user", user);
		modelAndView.setViewName("/index");
		
		return modelAndView;
	}
	
	
	
	
}
